﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NAnt.Core.Util;

namespace NAnt.SVN.Util
{
    /// <summary>
    /// Internal class to lookup strings via NAnt.Core. The problem.
    /// is that NAnt gives an error when a key is not found and that is solved in here.
    /// $Id$
    /// </summary>
    sealed internal class Strings
    {
        /// <summary>
        /// Lookup a string
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public static string GetString(string key)
        {
            try {
                return ResourceUtils.GetString(key);
            }
            catch(Exception e)
            {
                return string.Format("Cannot find '{0}': {1}", key, e.Message);
            }
        }
    }
}
